#include <gui/wifipage_screen/WiFiPageView.hpp>
#include <gui/wifipage_screen/WiFiPagePresenter.hpp>

WiFiPagePresenter::WiFiPagePresenter(WiFiPageView& v)
    : view(v)
{

}

void WiFiPagePresenter::activate()
{
		WiFiPagePresenterState(true);	
}

void WiFiPagePresenter::deactivate()
{
		WiFiPagePresenterState(false);	
}
//获取WiFi模组的RSSI值
void WiFiPagePresenter::updateWiFiRSSI(uint8_t (&pWiFiInfo)[40], uint16_t newRSSI)
{
    view.updateWiFiRSSI(pWiFiInfo, newRSSI);
}
//物理按键的页面跳转
void WiFiPagePresenter::WiFiPageChange(uint8_t newFiveKeyFunc)
{
		view.WiFiPageChange(newFiveKeyFunc);	
}
//WiFiPagePresenter状态
void WiFiPagePresenter::WiFiLinkTask(bool enable)
{
	if(enable == true)
		model->WiFiLinkTask(true);
	else
		model->WiFiLinkTask(false);
}
//ApplicationPagePresenter状态
void WiFiPagePresenter::WiFiPagePresenterState(bool enable)
{
		if(enable == true)
			model->WiFiPageViewTask(true);
		else
			model->WiFiPageViewTask(false);
}